<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use app\models\User;

/* @var $this yii\web\View */
/* @var $model app\models\User */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => '用户', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->userid], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->userid], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'userid',
            'name',
            [
                'attribute'=>'img',
                'format' => 'raw',
                'value'=>Html::img(\app\models\UploadForm::SHOW_DIR.$model->img,['width'=>'100px','height'=>'100px']),
            ],
            [
                'attribute' => 'sex',
                'value'=>User::dropdown('sex',$model->sex),
            ],
            'tele',
            'pwd',
            'take_money',
            'give_money',
            'fid',
            'sort',
            [
                'label'=>'地区',
                'value'=>$model->province.$model->city.$model->county,
            ],
            [
                'attribute' => 'type',
                'value'=>User::dropdown('type',$model->type),
            ],
            [
                'attribute' => 'created_at',
                'format' => ['date', 'php:Y-m-d']
            ],
            [
                'attribute' => 'updated_at',
                'format' => ['date', 'php:Y-m-d']
            ],
        ],
    ]) ?>

</div>
